/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-6-4 上午11:48 Created by lyyang
 */
package com.xunton.bss.weixin.api.message.event.coupon;



import javax.persistence.*;
import javax.xml.bind.annotation.XmlElement;

import com.xunton.bss.weixin.api.message.event.Event;

/**
 * 卡卷通用事件
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-6-4 上午11:48
 */
@Entity
@Table (name = "WEIXIN_COUPON_EVENT")
@Inheritance (strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="op_type", discriminatorType=DiscriminatorType.STRING)
public class CouponEvent extends Event
{
    public static final String USER_GET_CARD = "user_get_card";
    public static final String USER_CONSUME_CARD = "user_consume_card";
    public static final String USER_DEL_CARD = "user_del_card";

    @Id
    @GeneratedValue (generator = "WEIXIN_SEQ_COUPON_EVENT")
    @SequenceGenerator (name = "WEIXIN_SEQ_COUPON_EVENT", sequenceName = "WEIXIN_SEQ_COUPON_EVENT")
    private long id;

    @Column (name="owner_id")
    private String ownerId;

    @Column (name="owner_type")
    private String ownerType;

    @Column (name="card_id")
    @XmlElement (name = "CardId")
    private String cardId;


    public String getOwnerId()
    {
        return ownerId;
    }

    public void setOwnerId(String ownerId)
    {
        this.ownerId = ownerId;
    }

    public String getOwnerType()
    {
        return ownerType;
    }

    public void setOwnerType(String ownerType)
    {
        this.ownerType = ownerType;
    }

    public String getCardId()
    {
        return cardId;
    }

    public void setCardId(String cardId)
    {
        this.cardId = cardId;
    }

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getType(){
        return "coupon";
    }
}
